import 'package:flutter/material.dart';
import 'package:my_flutter_tool/util/app_util.dart';
import 'package:my_flutter_tool/widgets/video_flow/flow_item.dart';

///视频流
class VideoFlow extends StatefulWidget {
  const VideoFlow({Key key}) : super(key: key);

  @override
  _VideoFlowState createState() => _VideoFlowState();
}

class _VideoFlowState extends State<VideoFlow> {
  @override
  Widget build(BuildContext context) {
    return RefreshIndicator(
      onRefresh: () async {
        await Future.delayed(const Duration(seconds: 2), () {});
      },
      child: PageView.builder(
        physics: A.appPhysics,
        scrollDirection: Axis.vertical,
        itemBuilder: (_, index) => FlowItem(index: index),
      ),
    );
  }
}
